import VueI18n from './vue-i18n.js';//需先安装vue-i18n
import Vue from 'vue';
Vue.use(VueI18n);
import En from './locales/en.js';   
import Cn from './locales/cn.js';	  
import Ar from './locales/ar.js';    
import De from './locales/de.js';    
import Dt from './locales/dt.js';  
import Es from './locales/es.js'; 
import Fr from './locales/fr.js'; 
import Jp from './locales/jp.js';
import Kr from './locales/kr.js';
import Vn from './locales/vn.js';
import Nl from './locales/nl';
import Pt from './locales/pt';
import Ru from './locales/ru';


const messages = {
	'En': { message: En },
	'Cn': { message: Cn },
	'Ar': { message: Ar },
	'De': { message: De },
	'Dt': { message: Dt },
	'Es': { message: Es },
	'Fr': { message: Fr },
	'Jp': { message: Jp },
	'Kr': { message: Kr },
	'Vn': { message: Vn },
	'Nl': { message: Nl },
	'Pt': { message: Pt },
	'Ru': { message: Ru }
}
 
var lang = uni.getStorageSync("language") ? uni.getStorageSync("language") : 'Cn';
uni.setStorageSync("language", lang)


var i18n = new VueI18n({
  locale: lang,    // 语言标识
  messages
});

Vue.prototype.i18n = i18n; 
 
export default i18n